package com.ttwm.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.InetAddress;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

@RestController
@CrossOrigin
public class IPCommentController {
    @PostMapping(value = {"/ttwm/IP"})
    public Map<String ,Object> forgetUser() throws Exception{
        Map map = new HashMap<String ,Object>();
            InetAddress addr = InetAddress.getLocalHost();
//            System.out.println(addr.getHostAddress());
        map.put("success",true);
        map.put("msg","成功");
        map.put("IP",addr.getHostAddress());

        return map;
    }
}
